using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class DIC_DIC_CONTENEDOR : PaginaBaseKCG
{
    protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        
        Fv.ItemUpdating += new FormViewUpdateEventHandler(Fv_ItemUpdating);
        Fv.ItemInserting += new FormViewInsertEventHandler(Fv_ItemInserting);
        Fv.DataBound += new EventHandler(Fv_DataBound);
    }

    void Fv_ItemInserting(object sender, FormViewInsertEventArgs e)
    {
        string tipo = HER.Navegacion.ObtenerValorControl(Fv.FindControl("ddlTipo"));
        e.Values["Tipo"] = tipo;
        
        string filtro = HER.Navegacion.ObtenerValorControl(Fv.FindControl("rblFiltro"));
        e.Values["Filtro"] = filtro;
    }



    void Fv_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        string tipo = HER.Navegacion.ObtenerValorControl(Fv.FindControl("ddlTipo"));
        e.NewValues["Tipo"] = tipo;
        
        string filtro = HER.Navegacion.ObtenerValorControl(Fv.FindControl("rblFiltro"));
        e.NewValues["Filtro"] = filtro;
    }


    void Fv_DataBound(object sender, EventArgs e)
    {
        if(fvDicContenedor.CurrentMode == FormViewMode.Edit)
        {
            DropDownList ddlTipo = (DropDownList) Fv.FindControl("ddlTipo");
            TextBox txbTipo = (TextBox) Fv.FindControl("Tipo");
            ddlTipo.SelectedValue = txbTipo.Text;

            RadioButtonList rblFiltro = (RadioButtonList)Fv.FindControl("rblFiltro");
            TextBox txbFiltro = (TextBox)Fv.FindControl("Filtro");
            rblFiltro.SelectedValue = txbFiltro.Text;
        }
    }


    protected override CheckBox CbInsertarMemoria
    {
        get { return null; }
    }

    protected override Type TipoObjeto
    {
        get { return typeof(global::Dic_Contenedor); }
    }

    protected override GridView Gv
    {
        get { return gvDicContenedor; }
    }

    protected override FormView Fv
    {
        get { return fvDicContenedor; }
    }

    protected override ObjectDataSource OdsGv
    {
        get { return odsGvDicContenedor; }
    }

    protected override ObjectDataSource OdsDv
    {
        get { return odsFvDicContenedor; }
    }

    protected override Button BResponderZoom
    {
        get { return Seleccionar; }
    }

    protected override Button BRegreso
    {
        get { return Atras; }
    }

    protected override Koala.KoalaWebControls.KFiltro KftFiltro
    {
        get { return kftFiltro; }
    }
    protected override string Contenedor
    {
        get { return "DIC_CONTENEDOR"; }
    }
    protected void nav_Siguiente(object sender, EventArgs e)
    {
        Gv_SelectedIndexChanged(sender, e);
    }

}
